package com.example.xd.dialtest.js;

import android.util.Log;
import android.webkit.JavascriptInterface;

/**
 * @auther XuDan on 2019/12/13.
 */
public class InJavaScriptLocalObj {
    private String img_src = "";

    public String getImgSrc() {
        return this.img_src;
    }

    @JavascriptInterface
    public void getImgSrcById(String value) {
        this.img_src = value;
        Log.i("xd---", img_src);

    }


    private String a_herf = "";

    public String getAHerf() {
        return this.a_herf;
    }

    @JavascriptInterface
    public void getAHerfById(String value) {
        this.a_herf = value;
        Log.i("xd---", a_herf);

    }

    private String h_content = "";

    public String getHContent() {
        return this.a_herf;
    }

    @JavascriptInterface
    public void getHContentById(String value) {
        this.a_herf = value;
        Log.i("xd---", a_herf);

    }

    private String li_content = "";

    public String getLiContent() {
        return this.a_herf;
    }

    @JavascriptInterface
    public void getLiById(String value) {
        this.li_content = value;
        Log.i("xd---", li_content);

    }

    private String input_content = "";

    public String getInputContent() {
        return this.input_content;
    }

    @JavascriptInterface
    public void getInputContentById(String value) {
        this.input_content = value;
        Log.i("xd---", input_content);
    }

    private Boolean radio_isCheck = false;

    public Boolean getRadioIsCheck() {
        return this.radio_isCheck;
    }

    @JavascriptInterface
    public void getRadioIsCheckById(Boolean value) {
        this.radio_isCheck = value;
        if (value) {
            Log.i("xd---", "ischeck==true");
        } else {
            Log.i("xd---", "ischeck==false");

        }
    }

    private String btn_value = "";

    public String getBtn() {
        return this.btn_value;
    }

    @JavascriptInterface
    public void getBtnById(String value) {
        this.btn_value = value;
        Log.i("xd---", "" + btn_value);
    }

    private Boolean chexkbox_ischeck = false;

    public Boolean getCeckBoxIsCheck() {
        return this.chexkbox_ischeck;
    }

    @JavascriptInterface
    public void getCheckBoxIsCheckById(Boolean value) {
        this.chexkbox_ischeck = value;
    }


    @JavascriptInterface
    public void getRadionChecked(String name, String content) {
        switch (name) {
            case "sex":
                Log.i("xd---", content);
                break;
        }
    }

    @JavascriptInterface
    public void getCheckBoxChecked(String[] array) {
        for (int i = 0; i < array.length; i++) {
            Log.i("xd---", array[i]);
        }

    }
}
